﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Layouts/List.Master" EnableEventValidation="false"
    AutoEventWireup="true" CodeBehind="AddOrganizationProcessOrg.aspx.cs" Inherits="Bingosoft.WebApp.Modules.SecurityConsole.Organization.AddOrganizationProcessOrg" %>

<%@ Import Namespace="Bingosoft.Modules.SecurityConsole.Common.Helper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <web:Script ID="Script1" src="~/Modules/SecurityConsole/Common/FunctionControl/TreeListSelect/TreeListSelectObject.js"
        runat="server" />
    <web:Script ID="Script4" src="~/Modules/SecurityConsole/Common/FunctionControl/ListSelect/ListSelectControl.js"
        runat="server" />
    <web:Script ID="Script2" src="~/Modules/SecurityConsole/Common/FunctionControl/CategorySelect/CategorySelectControl.js"
        runat="server" />
    <script type="text/javascript">
        var Global = {};
        Global.contextPath = '<%= RequestHelper.GetContextPath(Request) %>';
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div class="datalist">
    <div id="roleOrg" style="margin-top: 10px;" runat="server">
        <h2 style="height:30px;">
            【<asp:Label ID="labOrg" runat="server" Text="Label"></asp:Label>】
        </h2>
        <div class="toolbar" style="height: 30px;">
            <asp:Button ID="btnAddOrg" runat="server" Text="添加部门" OnClientClick="return addOrg()"
                OnClick="btnAddOrg_Click" />
        </div>
        <web:SmartGridView DataSourceID="SmartSqlDataSource1" ID="gvRoleOrg" runat="server"
            AutoGenerateColumns="false" Width="100%" DataKeyNames="Id" AllowPaging="true">
            <Columns>
                <asp:BoundField DataField="Name" SortExpression="Name" HeaderText="部门名称" />
                <asp:TemplateField HeaderText="操作" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:ImageButton ID="roleOrgDelete" runat="server" ToolTip="移除" ImageUrl="~/Images/ico_del.gif"
                            _OrgId='<%#Eval("Id") %>' _KeyId='<%#Eval("WfRoleId")%>' CausesValidation="False"
                            OnClientClick="return window.confirm('您确认要移除该部门吗?')" OnClick="RoleOrgDelete">
                        </asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </web:SmartGridView>
        <web:SmartSqlDataSource ID="SmartSqlDataSource1" runat="server" SelectCommandAutoPageWrap="true"
            DefaultSortExpression="Id asc">
        </web:SmartSqlDataSource>
    </div>
    </div>
    <input type="hidden" runat="server" id="ReturnIds" />
    <input type="hidden" runat="server" id="ReturnNames" />
    <script type="text/javascript" language="javascript">
        function addOrg() {
            process({
                sqlId: 'organization.firstFloor.tree',
                childSqlId: 'organization.getChildren',
                title: '组织机构选择',
                idField: "<%= ReturnIds.ClientID %>",
                nameField: "<%= ReturnNames.ClientID %>",
                isAsyn: 'true',
                params: {}
            });
            return true;
        }
    </script>
</asp:Content>
